package com.sxf.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sxf.dao.TermRelationshipsDAO;
import com.sxf.domain.TermRelationships;
import com.sxf.mybatis.page.Pagination;
import com.sxf.querybean.TermRelationshipsQuery;

@Repository("termRelationshipsDAO")
public class TermRelationshipsDAOImpl extends SuperDAOImpl implements
		TermRelationshipsDAO {
	private static final String STATEMENT_QUERY = "mybatis.xml.TermRelationships.query";

	@Override
	public List<TermRelationships> queryList(TermRelationshipsQuery query) {
		return queryListTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public long queryNumber(TermRelationshipsQuery query) {
		return queryNumberTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public TermRelationships queryOne(TermRelationshipsQuery query) {
		return queryOneTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public Pagination<TermRelationships> queryPage(TermRelationshipsQuery query) {
		return queryPageTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public int insert(TermRelationships info) {
		if (info != null) {
			int i = st.insert("mybatis.xml.TermRelationships.insertSelective",
					info);
			return i;
		}
		return 0;
	}

	@Override
	public int update(TermRelationships info) {
		if (info != null) {
			return st
					.update("mybatis.xml.TermRelationships.updateByPrimaryKeySelective",
							info);
		}
		return 0;
	}

	@Override
	public int delete(TermRelationships info) {
		if (info != null) {
			return st.delete(
					"mybatis.xml.TermRelationships.deleteByPrimaryKey", info);
		}
		return 0;
	}

}
